package Day2;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            Float a = in.nextFloat();
            String b = in.next();
            if(a <= 1) {
                if(b.equals("y")){
                    System.out.print(25);
                }else{
                    System.out.print(20);
                }
                continue;
            }
            float sum = 20;
            a--;
            while(a > 0){
                a--;
                sum += 1;
            }
            if(b.equals("y")){
                System.out.print(sum+5);
            }else{
                System.out.print(sum);
            }
        }
    }
}